<template>
  <div class="b-article-table">
    <el-table :data="tableData" style="width: 100%" :border="true">
      <el-table-column
        align="center"
        type="selection"
        width="50"
      ></el-table-column>
      <el-table-column align="center" label="文章分类" width="240">
        <template slot-scope="scope">
          <el-tag
            size="medium"
            :effect="scope.row.tagEffect"
            :type="scope.row.tagType"
            >{{ scope.row.cate }}</el-tag
          >
        </template>
      </el-table-column>
      <el-table-column
        align="center"
        prop="title"
        label="文章标题"
        width="520"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="sort"
        label="排序"
        width="60"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="hits"
        label="阅读"
        width="60"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="collect"
        label="收藏"
        width="60"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="like"
        label="点赞"
        width="60"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="replies"
        label="回复"
        width="60"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="createTime"
        label="删除时间"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="updateTime"
        label="更新时间"
      ></el-table-column>
      <el-table-column align="center" label="管理" width="160">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
            >编辑</el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
            >还原</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="b-pagination">
      <el-pagination
        @current-change="jumpPage()"
        :current-page.sync="pagination.curr"
        :page-size="pagination.size"
        layout="total, prev, pager, next"
        :total="pagination.total"
        :hide-on-single-page="true"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
export default {
  name: "BArticleTable",
  data() {
    return {
      tableData: [
        {
          id: 1,
          cateId: 1,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "新建Laravel项目步骤",
          sort: "1",
          hits: "16",
          collect: "6",
          like: "8",
          replies: "2",
          isIndex: false,
          isShow: true,
          isHot: false,
          isTop: false,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 2,
          cateId: 1,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 3,
          cateId: 2,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 4,
          cateId: 5,
          tagEffect: "plain",
          tagType: "danger",
          cate: "生活随笔",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 5,
          cateId: 2,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 6,
          cateId: 8,
          tagEffect: "plain",
          tagType: "warning",
          cate: "生活随笔",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 7,
          cateId: 9,
          tagEffect: "light",
          tagType: "",
          cate: "团队管理",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 8,
          cateId: 1,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        }
      ],
      pagination: { curr: 1, size: 10, total: 1000 }
    };
  },
  methods: {}
};
</script>
<style>
.b-article-table {
  margin-top: 30px;
}
.b-pagination {
  margin-top: 20px;
}
.b-article-table .has-gutter > tr > th {
  border-top: 1px solid #ababab;
  border-bottom: 1px solid #ababab;
  border-right: 1px solid #dfdfdf;
  background: #ececec;
  color: #333;
}
</style>
